<%if !(@rolle == 'gast' and !item.activ)%>

	<%@item=item%>
	
	
	<%@description = render :partial => "description_show"%>
	

	<%if @rolle == "owner"%>
	
	    <%@delete = image_submit_tag("delete.png",
		        :onclick=>remote_function(:update => "#{item.id}_id", :alt=>'',
				:url => {:controller=>:items, :action => :destroy, :id=>item.id, :r=>params[:r]}, :method => :delete)
	     )%>
	
	     <%@move = image_tag('move_item.png',:class=>'pointer')%>
		 
	
		 	<%@checkimg = image_submit_tag(item.check? ? (item.activ? ? "checked.jpg" : "checked_dezent.jpg") : 
			(item.activ? ? "unchecked.jpg" : "unchecked_dezent.jpg") ,
				:onclick=>remote_function(:update => "#{item.id}_id",
				:url => {:controller=>:items, :action => :update, :id=>item.id, :r=>params[:r], :value_check=>!item.check?, 
            	:value_activ=>item.activ? }, :method => :put)
			)%>
		 <%if @item.shift && @item.shift > 0%>
				<%@left = image_submit_tag("left.png",
						:onclick=>remote_function(:update => "#{item.id}_id",
						:url => {:controller=>:items, :action => :left, :id=>item.id, :r=>params[:r]})
				)%>	
		 <%end%>
		 <%if (!@item.shift || @item.shift < 40)%>
			<%@right = image_submit_tag("right.png",
				:onclick=>remote_function(:update => "#{item.id}_id",
				:url => {:controller=>:items, :action => :right, :id=>item.id, :r=>params[:r]})
			)%>	
		 <%end%>
		 <% @active = check_box_tag ('item[activ]',item.activ? ? 1 : 0,item.activ?,{
  
             :id=>"item_activ_#{item.id}",
			 :onclick=> 
				remote_function(:update => "#{item.id}_id",
					:url => {:controller=>:items, :action => :update, :id=>item.id, :r=>params[:r], :value_activ=>!item.activ?,
            			:value_check=>item.check? },
					:method => :put)
			})%>
	
	<%elsif @rolle == "checker"%>
	
	    	<%@checkimg = image_submit_tag(item.check? ? (item.activ? ? "checked.jpg" : "checked_dezent.jpg") : 
			(item.activ? ? "unchecked.jpg" : "unchecked_dezent.jpg") ,
				:onclick=>remote_function(:update => "#{item.id}_id",
				:url => {:controller=>:items, :action => :update, :id=>item.id, :r=>params[:r], :value_check=>!item.check?, 
            	:value_activ=>item.activ? }, :method => :put)
		   )%>
		   
		   	 <% @active = check_box_tag ('item[activ]',item.activ? ? 1 : 0,item.activ?,{
  
             :id=>"item_activ_#{item.id}",
			 :onclick=> 
				remote_function(:update => "#{item.id}_id",
					:url => {:controller=>:items, :action => :update, :id=>item.id, :r=>params[:r], :value_activ=>!item.activ?,
            			:value_check=>item.check? },
					:method => :put)
			})%>
			<% @delete = " <div></div>" %>
		
	<%else%>
	
	    <%@checkimg = image_tag(item.check? ? "checked.jpg" : "unchecked.jpg")%>
		<% @delete = " <div></div>" %>
		 <% @active = " <div></div>" %>
	
	<%end%>




   <%=render :partial=>'item_component', :locals => { :left => @left,:check=>@checkimg, :desc=>@description,:right=>@right,
                                               :active=>@active,:del=>@delete,:move=>@move, :shift=>@item.shift,:id=>@item.id,
 												:undel=>0,:rolle=>@rolle}%>	



<% end %>